1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.google.common.collect;
18
19 import static com.google.common.testing.SerializableTester.reserialize;
20 import static junit.framework.Assert.assertEquals;
21 import static junit.framework.Assert.assertTrue;
22
23 import com.google.common.annotations.GwtCompatible;
24 import com.google.common.annotations.GwtIncompatible;
25 import com.google.common.testing.SerializableTester;
26
27 import java.util.Set;
28
29
30
31
32
33
34
35
36
37
38
39 @GwtCompatible(emulated = true)
40 final class LenientSerializableTester {
41
42
43
44
45
46 @GwtIncompatible("SerializableTester")
47 static <E> Set<E> reserializeAndAssertLenient(Set<E> original) {
48 Set<E> copy = reserialize(original);
49 assertEquals(original, copy);
50 assertTrue(copy instanceof ImmutableSet);
51 return copy;
52 }
53
54 @GwtIncompatible("SerializableTester")
55 static <E> Multiset<E> reserializeAndAssertLenient(Multiset<E> original) {
56 Multiset<E> copy = reserialize(original);
57 assertEquals(original, copy);
58 assertTrue(copy instanceof ImmutableMultiset);
59 return copy;
60 }
61
62 private LenientSerializableTester() {}
63 }